<script>
    // 其他类型转数字类型
    console.log('字符串转数字');
    var str1 = 'asdfasdf';
    var str2 = '';
    var str3 = ' ';
    var str4 = '666';

    console.log(Number(str1)); // NaN
    console.log(Number(str2)); // 0
    console.log(Number(str3));
    console.log(Number(str4)); // 666

    console.log('布尔类型转数组----=');
    var boo1 = true;
    var boo2 = false;
    console.log(Number(boo1));  // 1
    console.log(Number(boo2));  // 0

    console.log(boo1+boo2);  // 1

    console.log('undefined转数字-----');
    var y = undefined;
    console.log(Number(y));

    console.log('null转数字-----');
    var z = null;
    console.log(Number(z));

    console.log('对象转数字-----');
    var obj = {a:2, b:3}
    console.log(Number(obj)); // NaN







</script>